package com.mapgoo.implicitTest

/**
  *
  * @author eureka.wh
  * @since 2019-05-30 17:10
  */
object Demo01 extends App {

  implicit def man2superman(man:Man):Superman = new Superman(man.name)
  val man = new Man("PK")
  man.fly()
}

class Man(val name:String){
  def eat()={
    println(s"man [$name] eat ...")
  }

}

class Superman(val name:String){
  def fly()={
    println(s"superman [$name] fly ...")
  }
}